package com.achievement.project.system.teacher.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.achievement.project.system.teacher.mapper.TeacherMapper;
import com.achievement.project.system.teacher.domain.Teacher;
import com.achievement.project.system.teacher.service.ITeacherService;
import com.achievement.common.utils.text.Convert;

/**
 * 教师信息Service业务层处理
 *
 * @author zkai
 * @date 2021-04-24
 */
@Service
public class TeacherServiceImpl implements ITeacherService
{
    @Autowired
    private TeacherMapper teacherMapper;

    /**
     * 查询教师信息
     *
     * @param id 教师信息ID
     * @return 教师信息
     */
    @Override
    public Teacher selectTeacherById(Long id)
    {
        return teacherMapper.selectTeacherById(id);
    }

    /**
     * 查询教师信息列表
     *
     * @param teacher 教师信息
     * @return 教师信息
     */
    @Override
    public List<Teacher> selectTeacherList(Teacher teacher)
    {
        return teacherMapper.selectTeacherList(teacher);
    }

    @Override
    public List<Teacher> selectTeacherListForExcel(Teacher teacher)
    {
        return teacherMapper.selectTeacherListForExcel(teacher);
    }

    /**
     * 新增教师信息
     *
     * @param teacher 教师信息
     * @return 结果
     */
    @Override
    public int insertTeacher(Teacher teacher)
    {
        return teacherMapper.insertTeacher(teacher);
    }

    /**
     * 修改教师信息
     *
     * @param teacher 教师信息
     * @return 结果
     */
    @Override
    public int updateTeacher(Teacher teacher)
    {
        return teacherMapper.updateTeacher(teacher);
    }

    /**
     * 删除教师信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTeacherByIds(String ids)
    {
        return teacherMapper.deleteTeacherByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除教师信息信息
     *
     * @param id 教师信息ID
     * @return 结果
     */
    @Override
    public int deleteTeacherById(Long id)
    {
        return teacherMapper.deleteTeacherById(id);
    }

    @Override
    public int checkNumIsOnly(String number) {
        return teacherMapper.checkNumIsOnly(number);
    }


    @Override
    public Teacher selectTeacherByCourseId(Long courseId,Long classId) {
        return teacherMapper.selectTeacherByCourseId(courseId,classId);
    }
}
